#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<vector>

using namespace std;

bool isSumEqual(string firstWord, string secondWord, string targetWord) {
    return change(firstWord) + change(secondWord) == change(targetWord);
}

int change(string s)
{
    int res = 0;
    for (int i = 0; i < s.size(); i++)
    {
        res += s[i] - 'a';
        res *= 10;
    }
    return res;
}

int pivotIndex(vector<int>& nums) {
    int n = nums.size();
    vector<int> d(n + 1, 0);
    for (int i = 1; i <= n; i++)   d[i] = d[i - 1] + nums[i - 1];
    for (int i = 1; i <= n; i++)
    {
        int l = d[i - 1];
        int r = d[n] - d[i];
        if (l == r)  return i - 1;
    }
    return -1;
}